package com.chinasofti.list;

import java.util.Iterator;
import java.util.LinkedList;

public class Demo04 {
    public static void main(String[] args) {
        LinkedList<String>list = new LinkedList<>();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        //method1(list);
        list.removeFirst();
        list.removeLast();
        System.out.println("list = " + list);
    }

    private static void method1(LinkedList<String> list) {
        list.addFirst("qqq");
        list.addLast("ppp");
        System.out.println("list = " + list);
        System.out.println(list.getFirst());
        System.out.println(list.getLast());
    }
}
